<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<title></title>
	<meta charset="UTF-8">
	<title>凯胜项目管理系统</title>
	<link rel="stylesheet" href="static/css/bootstrap.min.css" />
	<link rel="stylesheet" href="static/css/daohang.css" type="text/css" />
	<link rel="stylesheet" href="static/css/style.css" type="text/css" />
	<style type="text/css">
		.icon-while{
			background-image: url("img/glyphicons-halflings-white.png");
		}
		
		body{
			background-image:url("static/img/bg_main.jpg");
		}
	</style>
</head>
<body>
	<%@ include file="include/top2.jsp" %>

	<jsp:include page="include/top.jsp">
		<jsp:param value="folder" name="tag"/>
	</jsp:include>
	<div class="container">
		<div class="row">
			<%-- <jsp:include page="include/side.jsp">
				<jsp:param value="new" name="tag"/>
			</jsp:include> --%>
			<div class="span9">
				<ul class="breadcrumb" style="margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:15px">
					<li class="active">
						<a href="#"><i class="icon-th"></i>文件列表>客户资料</a>
					</li>
					<li class="pull-right">
					<a data-toggle="modal" href="#myModal" ><i class="icon-plus"></i>上传文件</a>
						
						<div class="modal hide fade" id="myModal">
				
							<div class="modal-header">
								<button type="button" class="close" data-dismiss="modal">×</button>
								<h3>上传</h3>
							</div>
							
							<div class="modal-body">
								<form action="filer.jspx?m=upload&id=${folder.id }" method="post" enctype="multipart/form-data" class="form-horizontal">
								  <fieldset>
									<legend>upload</legend>
									<div class="control-group">
									  <label class="control-label" for="input01">文件名</label>
									  <div class="controls">
										<input type="text" class="input-xlarge" id="input01" name="desc">
									  </div>
									</div>
									<div class="control-group">
										<label class="control-label" for="input01">选择文件</label>
										<div class="controls">
											<input type="file" class="input-xlarge" id="input01" name="mydocument">
										</div>
									</div>
									<div class="modal-footer">
										<a href="#" class="btn" data-dismiss="modal">取消</a>
										<button type="submit" class="btn btn-primary">上传</button>
									</div>
								  </fieldset>
								</form>
							</div>
							
						</div>
					</li>
					
				</ul>
				<div class="wall">
					<table class="table table-striped">
						<thead>
							<tr>
								<th width="30px"></th>
								<th width="60%">名称</th>
								<th width="20%">大小</th>
								<th>创建人</th>
							</tr>
						</thead>
						<tbody>
						
						
						<c:forEach items="${filerList }" var="f">
							<c:choose>
								<c:when test="${fn:length(filerList) == 0 }">
									还没有文件
								</c:when>
								<c:otherwise>
								<tr>
										<td>
										<c:choose>
										<c:when test="${f.kind eq '.jpg' }">
											<img src="static/img/file/jpeg_image.png"/>
										</c:when>
										<c:when test="${f.kind eq '.png' }">
											<img src="static/img/file/pictures.png"/>
										</c:when>	
										<c:when test="${f.kind eq '.gif' }">
											<img src="static/img/file/gif.png"/>
										</c:when>	
										<c:when test="${f.kind eq '.pdf' }">
											<img src="static/img/file/pdf.png"/>
										</c:when>	
										<c:when test="${f.kind eq '.psd' }">
											<img src="static/img/file/psd.png"/>
										</c:when>	
										<c:when test="${f.kind eq '.txt' }">
											<img src="static/img/file/txt.png"/>
										</c:when>	
										<c:when test="${f.kind eq '.zip' }">
											<img src="static/img/file/zip.png"/>
										</c:when>	
										<c:when test="${f.kind eq '.rar' }">
											<img src="static/img/file/rar.png"/>
										</c:when>	
										<c:when test="${f.kind eq '.swf' }">
											<img src="static/img/file/swf.png"/>
										</c:when>	
										<c:when test="${f.kind eq '.css' }">
											<img src="static/img/file/css_gref.png"/>
										</c:when>	
										<c:when test="${f.kind eq '.html' }">
											<img src="static/img/file/html_htm_op.png"/>
										</c:when>	
										<c:when test="${f.kind eq '.bmp' }">
											<img src="static/img/file/bmp.png"/>
										</c:when>	
										<c:otherwise>
											<img src="static/img/file/powerpoint.png"/>
										</c:otherwise>
										</c:choose>
										</td>
										<td><a href="filer.jspx?m=download&f=${f.fileName}">${f.changeName}</a></td>
										<td>${f.sizes}MB</td>
										<td>${f.user.userName}</td>
								</tr>
								</c:otherwise>
							</c:choose>
						</c:forEach>	
							
						</tbody>
					</table> 
					<a href="folder.jspx">←返回</a>
				</div>
			</div>
		</div>
	</div>
	
	<script type="text/javascript" src="static/js/jquery.js"></script>
	<script type="text/javascript" src="static/js/bootstrap.min.js"></script>
	
	<script type="text/javascript" src="static/js/jqueryui.js"></script>
	<script type="text/javascript" src="static/js/jquery.illuminate.0.7.min.js"></script>
	
	<script type="text/javascript">
		$(document).ready(function(){
				
			$('#button').illuminate({
				'intensity': '0.5',
				'color': '#2c2c2c'
			});
				
		});
		
		$(document).ready(function(){
			$("#showModel").click(function(){
				$("#myModal").modal();
			});
		});
	</script>
	
</body>
</html>